﻿<nav class="breadcrumb" id="pathContainer"></nav>
<div class="Hui-article mt-10" id="roleManagement">
    <div class="eva-h2">
        <i class="Hui-iconfont Hui-iconfont-fenlei"></i>
        <span class="c-primary">角色管理</span>
        <div class="f-r">
            <button class="btn btn1 radius btn_add" onclick="roleNewData()" style="display: inline-block;"><i class="Hui-iconfont Hui-iconfont-add"></i>新增</button>
        </div>
    </div>
    <div class="table-scroll">
        <table class="table table-border table-bordered">
            <thead class="text-c row cl table-bgcolor-gary">
                <tr>
                    <th>序号</th>
                    <th>角色名称</th>
                    <th>授权</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody class="text-c row cl" id="ColumnTableData"></tbody>
        </table>
    </div>
    <!-- 分页 start -->
    <div class="page pt-10 clearfix">
        <div class="f-l" style="white-space: nowrap;" id="pageContainer"></div>
        <div class="f-r" id="pageBtn">
            <input type="button" value="首页" class="page-btn" id="firstPage">
            <input type="button" value="上一页" class="page-btn" id="prevPage">
            <input type="button" value="下一页" class="page-btn" id="nextPage">
            <input type="button" value="尾页" class="page-btn" id="lastPage">
        </div>
    </div>
    <!-- 分页 end -->
</div>
<table id="onClickDataTable" class="page table table-border table-bordered table-hover col-98" style="display:none">
</table>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <h3 id="myModalLabel" class="h3">删除</h3>
        <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
    </div>
    <div class="modal-body">
        <p class="mb-10">您好，确认删除这个角色么？</p>
    </div>
    <div class="modal-footer">
        <button class="btn btn-secondary radius" onClick="postRoleDelData()">确定</button>
        <button class="btn radius" data-dismiss="modal" aria-hidden="true">关闭</button>
    </div>
</div>
<!-- 动态模板-分割  -->
<script id="navMain" type="text/x-handlebars-template">
    <i class="Hui-iconfont Hui-iconfont-weizhi"></i>
    <span>您的位置：</span>
    <span>系统配置</span>
    <span class="c-999 en">&gt;</span>
    <span class="c-primary">角色管理</span>
</script>
<script id="navAdd" type="text/x-handlebars-template">
    <i class="Hui-iconfont Hui-iconfont-weizhi"></i>
    <span>您的位置：</span>
    <span>系统配置</span>
    <span class="c-999 en">&gt;</span>
    <span>角色管理</span>
    <span class="c-999 en">&gt;</span>
    <span class="c-primary">新增</span>
    <input class="btn size-MINI radius f-r mr-30 mt-5" type="button" value="返回" onClick="roleManagement()">
</script>
<script id="navCheck" type="text/x-handlebars-template">
    <i class="Hui-iconfont Hui-iconfont-weizhi"></i>
    <span>您的位置：</span>
    <span>系统配置</span>
    <span class="c-999 en">&gt;</span>
    <span>角色管理</span>
    <span class="c-999 en">&gt;</span>
    <span class="c-primary">查看</span>
    <input class="btn size-MINI radius f-r mr-30 mt-5" type="button" value="返回" onClick="roleManagement()">
</script>
<script id="navEdit" type="text/x-handlebars-template">
    <i class="Hui-iconfont Hui-iconfont-weizhi"></i>
    <span>您的位置：</span>
    <span>系统配置</span>
    <span class="c-999 en">&gt;</span>
    <span>角色管理</span>
    <span class="c-999 en">&gt;</span>
    <span class="c-primary">编辑</span>
    <input class="btn size-MINI radius f-r mr-30 mt-5" type="button" value="返回" onClick="roleManagement()">
</script>
<script id="getColumnTableData" type="text/x-handlebars-template">
    \{{#each result.resultList}}
    <tr getId="\{{id}}" name="\{{name}}">
        <td>\{{Math @index '+' '1'}}</td>
        <td>\{{name}}</td>
        <td class="ellipsis">
            \{{#each permissions}} \{{description}} \{{/each}}
        </td>
        <td>
            \{{#mccmsShowIfEqual status '0'}}启用\{{/mccmsShowIfEqual}} \{{#mccmsShowIfEqual status '1'}}停用\{{/mccmsShowIfEqual}}
        </td>
        <td>
            <!--          <input class="btn btn-secondary size-S radius" type="button" value="查看" onClick="checkDataRole(this)">
                <input class="btn btn-secondary size-S radius" type="button" value="编辑" onClick="editDataRole(this)">
                <a data-toggle="modal" href="#myModal" class="btn btn-danger  size-S radius" onClick="delRoleMode(this)">删除</a> -->
            <button type="button" class="btn btn-secondary size-S radius detail_btn" onClick="checkDataRole(this)">查看</button>
            <button type="button" class="btn btn-secondary size-S radius edit_btn" onClick="editDataRole(this)">编辑</button>
            <a data-toggle="modal" href="#myModal" class="btn btn-danger  size-S radius" onClick="delRoleMode(this)">删除</a>
        </td>
    </tr>
    \{{/each}}
</script>
<script id="getCheckDataRole" type="text/x-handlebars-template">
    <!--查看-->
    <tr>
        <td class="col-1 text-r table-bgc-f5">角色名称 ：</td>
        <td class="col-11">
            <input type="text" disabled="disabled" class="input-text input-col-3 bgTextColoe" value="\{{result.name}}">
        </td>
    </tr>
    <tr>
        <td class="col-1 text-r table-bgc-f5 va-t">授权：</td>
        <td class="col-11">
            <textarea class="input-text input-col-3 bgTextColoe" disabled="disabled">\{{#each result.permissions}}&nbsp;&nbsp;\{{description}}\{{/each}}</textarea>
        </td>
    </tr>
    <tr>
        <td class="col-4 text-c table-bgc-f5">菜单</td>
        <!--   {{!-- <td class="col-4 text-c table-bgc-f5">栏目</td>
      <td class="col-4 text-c table-bgc-f5">功能</td> --}} -->
    </tr>
    <tr>
        <td class="col-4 ztree va-t" id="roleMenuTree"></td>
        <td class="col-4 ztree va-t hidden" id="roleFrontTree"></td>
        <td class="col-4 va-t skin-minimal hidden" id="roleOptTree"></td>
    </tr>
    <tr>
        <td class="col-1 text-r table-bgc-f5">状态 ：</td>
        <td class="col-11">
            <span class="select-box input-col-3" disabled="disabled">
                <select class="select selectVal" disabled="disabled" name="status" size="1" id="status">
                    \{{#mccmsSelect result.status}}
                        <option value="0">已启用</option>
                        <option value="1">已停止</option>
                    \{{/mccmsSelect}}
                </select>
            </span>
        </td>
    </tr>
</script>
<script id="getEditDataRole" type="text/x-handlebars-template">
    <tr id="roleId">
        <td class="col-4 text-r table-bgc-f5">角色名称 ：</td>
        <td class="col-8" colspan="2">
            <input type="text" class="input-text input-col-3 bgTextColoe" value="\{{result.name}}" id="roleDescription">
        </td>
    </tr>
    <tr>
        <td class="col-4 text-r table-bgc-f5">状态 ：</td>
        <td class="col-8" colspan="2">
            <span class="select-box input-col-3">
                <select class="select selectVal" name="status" size="1" id="status">
                    \{{#mccmsSelect result.status}}
                        <option value="0">已启用</option>
                        <option value="1">已停止</option>
                    \{{/mccmsSelect}}
                </select>
            </span>
        </td>
    </tr>
    <tr>
        <td class="col-12 text-c table-bgc-f5" colspan="3">授权</td>
    </tr>
    <tr>
        <td class="col-4 text-c table-bgc-f5">菜单</td>
        <!--   {{!-- <td class="col-4 text-c table-bgc-f5">栏目</td>
      <td class="col-4 text-c table-bgc-f5">功能</td> --}} -->
    </tr>
    <tr>
        <td class="col-4 ztree va-t" id="roleMenuTree"></td>
        <td class="col-4 ztree va-t hidden" id="roleFrontTree"></td>
        <td class="col-4 va-t skin-minimal hidden" id="roleOptTree"></td>
    </tr>
    <tr>
        <td class="col-12 text-c" colspan="3">
            <input type="button" class="btn btn-secondary radius save-btn" value="提交" onClick="postRoleEditData()">
        </td>
    </tr>
</script>
<script id="getNewDataRole" type="text/x-handlebars-template">
    <tr id="roleId">
        <td class="col-4 text-r table-bgc-f5">角色名称 ：</td>
        <td class="col-8" colspan="2">
            <input type="text" class="input-text input-col-3 bgTextColoe" value="" id="roleDescription">
        </td>
    </tr>
    <tr>
        <td class="col-4 text-r table-bgc-f5">状态 ：</td>
        <td class="col-8" colspan="2">
            <span class="select-box input-col-3">
                <select class="select selectVal" size="1" id="select">
                    <option value="0">已启用</option>
                    <option value="1">已停止</option>
                </select>
            </span>
        </td>
    </tr>
    <tr>
        <td class="col-12 text-c table-bgc-f5" colspan="3">授权</td>
    </tr>
    <tr>
        <td class="col-4 text-c table-bgc-f5">菜单</td>
        <td class="col-4 text-c table-bgc-f5">栏目</td>
        <td class="col-4 text-c table-bgc-f5">功能</td>
    </tr>
    <tr>
        <td class="col-4 ztree va-t" id="roleMenuTree"></td>
        <td class="col-4 ztree va-t" id="roleFrontTree"></td>
        <td class="col-4 va-t skin-minimal" id="roleOptTree"></td>
    </tr>
    <tr>
        <td class="col-12 text-c" colspan="3">
            <input type="button" class="btn btn-secondary radius" value="提交" onClick="postRoleNewData()">
        </td>
    </tr>
</script>
<!-- 分页  start -->
<script id="page" type="text/x-handlebars-template">
    <span>共有\{{rowCount}}条记录，</span>
    <label for="ipt2">每页行数：</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageSize">
            <option value="10" selected>10</option>
            <option value="20">20</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="200">200</option>
            <option value="300">300</option>
        </select>
    </span>
    <label for="ipt2">当前第</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageCount">
            \{{#each pageCount}}
            <option value="\{{pageCount}}">\{{pageCount}}</option>
            \{{/each}}
        </select>
    </span>
    <span>页</span>
</script>
<!-- 分页  end -->
<script>
new roleManagement();
</script>
<!-- 菜单栏模板 -->
<script id="navMenu" type="text/x-handlebars-template">
    <dl class="items w-220">
        <h4 class="current">
                    <!-- <i class="Hui-iconfont Hui-iconfont-fenlei fenlei-icon icon-arrow"></i> -->
                </h4>
    </dl>
    <ul id="Huifold" class="Huifold posi-a top-30 w-100p">
        \{{#each data}} \{{#if child}}
        <dl class="item manage-icon">
            <h4>
                    <i class="Hui-iconfont  \{{#if logo}}\{{logo}}\{{else}}Hui-iconfont-xiajia\{{/if}}"></i>
                    \{{description}}
                    <i class="Hui-iconfont arrow-list Hui-iconfont-arrow2-bottom menu_dropdown-arrow"></i>
                </h4>
            <dd class="info">
                <ul>
                    \{{#each child}}
                    <li class=""><a href="\{{uri}}" class="primary ajaxLoad nav_icon_css">\{{description}}</a> </li>
                    \{{/each}}
                </ul>
            </dd>
        </dl>
        \{{/if}} \{{#unless child}}
        <dl class="item column-setting-item">
            <a href="\{{uri}}" class="ajaxLoad">
                <h4>
                        <i class="Hui-iconfont \{{#if logo}}\{{logo}}\{{else}}Hui-iconfont-manage\{{/if}}"></i>
                        \{{description}}
                        <!-- <i class="Hui-iconfont Hui-iconfont-arrow2-bottom menu_dropdown-arrow"></i> -->
                    </h4>
            </a>
        </dl>
        \{{/unless}} \{{/each}}
</script>